﻿using System;
using System.Collections.Generic;

using NUnit.Framework;
using Yawf.Core.Logs;

namespace Yawf.Core.Xml {
	[TestFixture]
	public class XmlValidatorTest {

		[Test]
		public void TestValidarXmlDocument() {
			List<String> errores;
			String ruta,rutaXsd;

			ruta = AppDomain.CurrentDomain.BaseDirectory + "/Resources/Registros.xml";
			rutaXsd = AppDomain.CurrentDomain.BaseDirectory + "/Resources/sitret.xsd";

			errores = (new XmlValidator()).ValidarXmlDocument(ruta,rutaXsd);
			Assert.IsTrue(errores.Count <= 0,"Validation de xml contra esquema fallo");

			rutaXsd = AppDomain.CurrentDomain.BaseDirectory + "/Resources/Otro.xsd";
			errores = (new XmlValidator()).ValidarXmlDocument(ruta,rutaXsd);
			Assert.IsTrue(errores.Count > 0,"Validation de xml contra esquema NO fallo");
		}
	
	}
}
